package com.pactera.asmp.server.common.exception;


import javax.validation.constraints.NotBlank;
import lombok.NonNull;


public class GenericException extends RuntimeException {

    @NonNull
    private final GenericError error;

    public GenericException(@NonNull GenericError error) {
        super(error.getMessage());
        this.error = error;
    }

    public GenericException(@NonNull GenericError error, Throwable cause) {
        super(cause);
        this.error = error;
    }

    public GenericException(@NonNull GenericError error, @NotBlank String message) {
        super(message);
        this.error = error;
    }

    public GenericException(@NonNull GenericError error, @NotBlank String message, Throwable cause) {
        super(message, cause);
        this.error = error;
    }


    public GenericError getGenericError() {
        return error;
    }

}
